<!DOCTYPE html>
<html>
    <head>
        <meta name="author" content="Kwh">
        <meta charset="utf-8">
        <script src="../js/jquery-3.1.1.js"></script>
        <title></title>
        <style>
            ul{
                list-style: none;
            }
            ul li{
                width: 100px;
                height: 35px;
                border: 1px solid gray;
                border-radius: 10px;
                text-align: center;
                line-height: 2;
                float: left;
                margin-left: 10px;
            }
            .on{
                border-color: red;
            }
        </style>
    </head>
    <body>
       <ul>
           <li>1</li>
           <li>2</li>
           <li>3</li>
       </ul> 
    </body>
</html>

<script>
    
    $('li').click(function(){

        if($(this).hasClass('on')==true){
            $(this).removeClass('on');
        }else{
            $(this).addClass('on').siblings().removeClass('on');
        }

        
    })




</script>